﻿@{
    Layout = "~/Views/Shared/_FormWhite.cshtml";
}

<div class="wrapper animated fadeInRight">
    <form id="form" class="form-horizontal m-t">
        <div class="form-group">
            <label class="col-sm-2 control-label">档案</label>
            <div class="form-control-static" col="Name"></div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">年龄</label>
            <div class="form-control-static" col="Age"></div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">生日</label>
            <div class="form-control-static">
                <pre><span col="Birthday"></span></pre>
            </div>
        </div>        
    </form>
</div>

<script type="text/javascript">
    var id = ys.request("id");
    $(function () {
        getForm();
    });

    function getForm() {
        if (id > 0) {
            ys.ajax({
                url: '@Url.Content("~/TrainingManage/Teacher/GetFormJson")' + '?id=' + id,
                type: "get",
                success: function (obj) {
                    if (obj.Tag == 1) {
                        var result = obj.Result;
                        result.Name = (ys.isNullOrEmpty(result.Name) ? "" : result.Name)  ;
                        result.Birthday = ys.formatDate(result.Birthday, "yyyy-MM-dd"); 

                        $("#form").setWebControls(result);
                    }
                }
            });
        }
    }
</script>
